#ifndef unigame_Math_h
#define unigame_Math_h

#include <math.h>
#include "config/MathDef.h"
#include "config/Def.h"
#include "Interpolation.h"

#define PI 3.1415926f
#define MULT_TO_RAD 0.01745329f
#define MULT_TO_ANGLE 57.29578049f

namespace unigame
{
	class Math
	{
	public:
		static float invSqrt(float value);
		
		inline static float angToRad(float ang)
		{
			return ang / 180 * PI;
		}

		inline static float radToAng(float rad)
		{
			return rad / PI * 180;
		}

		inline static bool floatEqual(const float a, const float b)
		{
			return (a + MATH_DELTA_MIN) >= b && (a - MATH_DELTA_MIN) <= b;
		}

		inline static bool floatBiggerOrEqual(const float a, const float b)
		{
			return a >= (b - MATH_DELTA_MIN);
		}

		inline static bool floatSmallerOrEqual(const float a, const float b)
		{
			return a <= (b + MATH_DELTA_MIN);
		}
	};
}

#endif